import request from '@/utils/request'
export const getDepartments = () => {
  return request({
    url: '/company/department'
  })
}
export const delDepartments = data => {
  return request({
    url: `/company/department/${data}`,
    method: 'DELETE'
  })
}
// 获取部门负责人列表
export const getDepartmentsManager = () => {
  return request({
    url: '/sys/user/simple'
  })
}
// 新增子部门
export const addDepartment = data => {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 获取部门详情
export const getDepartment = id => {
  return request({
    url: `/company/department/${id}`
  })
}
// 编辑部门详情
export const editDepartment = data => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data

  })
}
